*****Summary of File 
*Statistics referenced in text (not tables)
*Table A2
*Table A3
*Table 1
*Figure A1
*Table 5
*Table A13
*Table 2, Table A4, Table A5, Table A6, Table A7
*Table 7
*Table 6, Table A14, Table A15, Table A16 (created by loop)
*Table 3
*Table A8
*Table A9
*Table 4, Table A10, Table A11, Table A12
*Table A1


set more off
clear all
tempfile mbketi

set seed 2389
set maxvar 32767
set matsize 600

use Data\ReSTAT_dataset.dta, clear

xtset sheno_num month 

*characteristics of interest: 
local demographic "female married"
local phone "owns_mobile phone_savvy top_up_min_distance"
local bank "bank_distance_B bank_distance_C bank_experience "
local characteristics "hyperbolic_a month_discount_rate willing_risk"
local outcomes_baseline "q11_6_1_r_hs nonbank_svg_r_hs q11_6_3_r_hs q11_6_5_r_hs q11_1_31_r_hs"

*outcomes of interest in inverse hyperbolic sine: 
local outcomes_all_hs "saved_f q11_6_1_r_hs nonbank_svg_r_hs q11_6_2_r_hs q11_6_3_r_hs q11_6_4_r_hs saved_t q11_6_5_r_hs" 
local outcomes_late_hs "saved_partner q11_6_1a_r_hs q11_6_1b_r_hs" 
local outcomes_all_hs_price "saved_f q11_6_1_r_hs saved_t q11_6_5_r_hs" 
local outcomes_late_hs_price "saved_partner q11_6_1a_r_hs"
local consumption_hs "q11_1_31_r_hs q11_8_34_r_hs" 
local labor_supply_hs "q11_2_1_r_hs q11_3_1_r_hs" 

*outcomes of interest in levels: 
local outcomes_all "q11_6_1_r nonbank_svg_r q11_6_2_r q11_6_3_r q11_6_4_r q11_6_5_r"
local outcomes_late "q11_6_1a_r q11_6_1b_r" 
local outcomes_all_tr "q11_6_1_r_tr nonbank_svg_r_tr q11_6_2_r_tr q11_6_3_r_tr q11_6_4_r_tr q11_6_5_r_tr" 
local outcomes_late_tr "q11_6_1a_r_tr q11_6_1b_r_tr" 
local outcomes_late_price "q11_6_1a_r"
local outcomes_all_price "q11_6_1_r q11_6_5_r"
local consumption_levels " q11_1_31_r q11_8_34_r"
local labor_supply "q11_2_1_r q11_3_1_r" 

*main ITT, code for output on tex files: 
local final_all "estsaved_f estq11_6_1_r_hs estsaved_t estq11_6_5_r_hs"
local final_pre "estsaved_partner estq11_6_1a_r_hs"
local final_all_expand "estq11_6_1_r_hs estq11_6_2_r_hs estq11_6_3_r_hs estq11_6_4_r_hs estq11_6_5_r_hs"
local final_pre_expand "estq11_6_1a_r_hs estq11_6_1b_r_hs"
local final_all_level "estq11_6_1_r estq11_6_2_r estq11_6_3_r estq11_6_4_r estq11_6_5_r"
local final_pre_level "estq11_6_1a_r estq11_6_1b_r"
local final_all_trim "estq11_6_1_r_tr estq11_6_2_r_tr estq11_6_3_r_tr estq11_6_4_r_tr estq11_6_5_r_tr"
local final_pre_trim "estq11_6_1a_r_tr estq11_6_1b_r_tr"
local ancova "ancsaved_f ancq11_6_1_r_hs ancsaved_t ancq11_6_5_r_hs"


**********Statistics referenced in text (i.e., not in tables)
tab typical_formal_deposit if panel_sample == 1 & round == 1 //Section 2.1
summ tops_up_wkly saved_f if panel_sample == 1 & round == 1 //Section 2
summ self_employed temp_employ if panel_sample == 1 & round == 1 //Section 2
summ `outcomes_baseline' `outcomes_all' if panel_sample == 1 & post == 0 //Section 2.6
summ `outcomes_baseline' `outcomes_all' if panel_sample == 1 & post == 0, detail //Section 2.6
tab frequency_of_deposit if panel_sample  ==1 & round == 1 //Section 2.6
tab formal_balance if panel_sample == 1 & round == 1 //Section 2.6
summ q11_1_31_r if formal_balance < 10000 & panel_sample == 1 & round == 1 //Section 2.6
gen percent_formal = q11_6_1_r/q11_6_5_r
summ percent_formal if panel_sample == 1 & post == 0 & q11_6_5_r > 0 //Section 2.6
summ made_deposit_r made_withdrawal_r if panel_sample == 1 & post == 0 & monthlysurvey == 1 & round != 5 //question not asked in baseline and with different recall period in Round 5
gen total_bank_time = time_bank*2+time_deposit 
gen time_saved = top_up_min_distance/total_bank_time 
summ top_up_within_200 top_up_min_distance total_bank_time time_bank time_deposit cost_travel_bank if panel_sample == 1 & round == 1 //Section 2.6
summ saved_f saved_t saved_cash saved_seetu saved_inf_other if panel_sample == 1 & tr1 == 1 & post == 0 //Section 2

gen mobile_channel_deposit = deposit/q11_6_1a_r
summ mobile_channel_deposit deposit q11_6_1a_r if panel_sample == 1 & tr2 == 1 & monthlysurvey == 1
summ mobile_channel_deposit deposit q11_6_1a_r if panel_sample == 1 & tr2 == 1 & has_one_transaction == 1 & monthlysurvey == 1
summ mobile_channel_deposit deposit q11_6_1a_r if panel_sample == 1 & tr2 == 1 & has_ten_transaction == 1 & monthlysurvey == 1


*Survey 11 for summary statistics on savings method preferences: 
tempfile summary
save `summary', replace

use "Data\SurveyRound11.dta", clear //
sort sheno
merge 1:m sheno using `summary'
drop if _merge == 2

tab q10_4_6a if panel_sample == 1 & monthlysurvey == 1
use `summary', clear 


*******Table A.2

*total sample: 
eststo: estpost summ `demographic' `characteristics'  `phone' `bank'  q11_6_1_r q11_6_5_r if round == 1 & panel_sample == 1
*monthly sample: control and 0% 
bysort treat_final: eststo: estpost summ `demographic' `characteristics' `phone' `bank'    q11_6_1_r q11_6_5_r  if round == 1 & monthlysurvey == 1 & panel_sample == 1
*annual sample: 0, 2, 4, 8 percent: 
bysort treat_final: eststo: estpost summ `demographic' `characteristics' `phone' `bank'   q11_6_1_r q11_6_5_r  if round == 1 & monthlysurvey == 0 & panel_sample == 1


esttab using "output\TableA2.tex", replace cells("mean(pattern(1 1 1 1 1 1 1) fmt(3))") booktabs substitute(\begin{tabular} \setlength{\linewidth}{.1cm}\newcommand{\contents}{\begin{tabular}  \end{tabular} \end{tabular}}\setbox0=\hbox{\contents}\setlength{\linewidth}{\wd0-2\tabcolsep-.25em}\contents {l}{\footnotesize {p{\linewidth}}{\footnotesize ) ///
label collabels(none) mlabels(" " "Control" "0\%" "0\%" "2\%" "4\%" "8\%") ///
mgroups("Total Sample" "Monthly Sample" "Annual Sample", pattern(1 1 0 1 0 0 0) span prefix(\multicolumn{@span}{c}{) suffix(}) end( \hline)) ///
nonotes addnotes(Variable definitions are provided in Appendix. For any given variable, at most two observations in a given category were missing a response. Sample is conditional on being in the Panel Sample. Comparisons are made to the 0\% fee of the same survey frequency: Column 2 is compared to Column 3, and Column 5 to 7 is compared with Column 4. Comparisons across sub-samples include variables upon which the random assignment were stratified and uses robust standard errors. *p<.10, **p<.05, ***p<.01.)

eststo clear

*regressions for balance indicated in A2: 
foreach var of varlist `demographic' `characteristics' `phone' `bank'    q11_6_1_r q11_6_5_r  `outcomes_baseline' {
	foreach treat of varlist tr1 {
		reg `var' `treat' i.balancequartile i.text_read if (tr2  == 1 | `treat' == 1) & round == 1 & monthlysurvey == 1 & panel_sample == 1, robust
	}
	foreach treat of varlist tr3 tr4 tr5{
		reg `var' `treat' i.balancequartile i.text_read if (tr2  == 1 | `treat' == 1) & round == 1 & monthlysurvey == 0 & panel_sample == 1, robust
	}
}

******Table A.3: 
preserve
keep if post == 0
foreach var of varlist `outcomes_all_hs'{
	bysort sheno: egen `var'_m = mean(`var')
}

***Panel A: 
foreach var of varlist `outcomes_all_hs' {
		eststo est`var': reg `var'_m tr2 i.balancequartile i.text_read if (tr2 == 1 | tr1 == 1) & monthlysurvey == 1 & panel_sample == 1, vce(cluster sheno) 
}


esttab `final_all' using "output\TableA3.tex", replace label se star(* 0.10 ** 0.05 *** 0.01) nogaps ///
	booktabs ///
	substitute(\begin{tabular} \setlength{\linewidth}{.1cm}\newcommand{\contents}{\begin{tabular}  \end{tabular} \end{tabular}}\setbox0=\hbox{\contents}\setlength{\linewidth}{\wd0-2\tabcolsep-.25em}\contents {l}{\footnotesize {p{\linewidth}}{\footnotesize ) ///
	varlabels(tr2 "Free Mobile Deposit Offer") ///
	keep (tr2) nonotes 
eststo clear

***Panel B:
foreach var of varlist `outcomes_all_hs'{
		eststo est`var': reg `var'_m tr3 tr4 tr5 i.balancequartile i.text_read if post == 0 & treat_final != 0 & monthlysurvey == 0 & annual_round == 1 & panel_sample == 1, vce(cluster sheno) 
}

esttab `final_all'  using "output\TableA3.tex", append label se star(* 0.10 ** 0.05 *** 0.01) nogaps ///
booktabs ///
substitute(\begin{tabular} \setlength{\linewidth}{.1cm}\newcommand{\contents}{\begin{tabular}  \end{tabular} \end{tabular}}\setbox0=\hbox{\contents}\setlength{\linewidth}{\wd0-2\tabcolsep-.25em}\contents {l}{\footnotesize {p{\linewidth}}{\footnotesize ) ///
varlabels(tr3 "2\% Fee" tr4 "4\% Fee" tr5 "8\% Fee") ///
keep (tr3 tr4 tr5) mlabels(none) collabels(none) nonumbers ///
addnotes(Panel A are estimated on the monthly sample and Panel B is estimated on the annual sample. All regressions use the panel sample, defined as having at least one observation in the post-treatment. Outcomes are monthly flows over the month prior to the survey wave, and the unit of observation is the individual month. Savings variables are analyzed using the Inverse Hyperbolic Sine, so the interpretation is as a log (percent impacts). Control (Free) Mean are the mean of all individual-monthly flows in the pre-intervention months for those in the control (free treatment and annual sample). All regressions control for the stratification variables used in the randomization protocol and cluster the standard errors at the individual level.) 
eststo clear

summ `outcomes_all_hs' if post == 0 & tr1 == 1 & panel_sample == 1
summ `outcomes_all_hs' if post == 0 & tr2 == 1 & panel_sample == 1 & annual_round == 1
restore





**********Table 1

bysort treat_final: eststo: estpost summ offermade takeup demo has_one_transaction has_ten_transaction total_deposit if round == 1 & panel_sample == 1 & treat_final != 0

esttab using "output\Table1.tex", replace cells("mean(pattern(1 1 1 1) fmt(3))") booktabs substitute(\begin{tabular} \setlength{\linewidth}{.1cm}\newcommand{\contents}{\begin{tabular}  \end{tabular} \end{tabular}}\setbox0=\hbox{\contents}\setlength{\linewidth}{\wd0-2\tabcolsep-.25em}\contents {l}{\footnotesize {p{\linewidth}}{\footnotesize ) ///
label collabels(none) mlabels("0\%" "2\%" "4\%" "8\%")  ///
varlabels (offermade "Letter Delivered" takeup "Account Accepted" demo "Demonstration completed" has_one_transaction "Used Service" has_ten_transaction "Frequent User" total_deposit "Amount Deposited, LKR") ///
addnotes ("Letter Delivered and Account Accepted are based on enumerator reports. Demonstration completed, Used service, Frequent user, Amount Deposited are based on institutional data provided by Ceylon Bank. Demonstration completed indicates that the individual is observed in the partner bank's dataset as having used the service. Frequent user is an indicator of individuals who used the service 10 times or more. Amount Deposited refers to the total amount deposited through the mobile-deposit system. The 0\% sample combines those surveyed annually and monthly. Statistical significance is based on regressions which include variables upon which the random assignment were stratified and uses robust standard errors. Observations are limited to individuals in the panel sample. Comparisons to the free mobile service offer are indicated by * p<0.1,  ** p<0.05,  *** p<0.01.")
eststo clear


*regressions across treatment arms to note significance:
foreach var of varlist offermade takeup demo has_one_transaction has_ten_transaction total_deposit{
	foreach treat of varlist tr3 tr4 tr5{
		reg `var' `treat' i.balancequartile i.text_read if (tr2 == 1 | `treat' == 1) & round == 1 & panel_sample == 1, robust
	}
}

**********Figure A1
histogram total_deposit if treat_final == 1 & panel_sample ==1 & round == 1 & total_deposit > 0, fraction saving(output\FigureA1, replace)/*free treatment arm*/

**********Table 5

*demeaning variables: 
foreach var of varlist takeup demo has_one_transaction total_deposit_hs total_deposit ever_partner_annual {
	reg `var' `demographic' `phone' `bank' `characteristics' q11_6_1_r_hs q11_6_5_r_hs q11_1_31_r_hs monthlysurvey tr3 tr4 tr5 if round == 1 & treated == 1 & offermade != 0 & panel_sample == 1, robust
	
	preserve
	foreach i of varlist takeup demo has_one_transaction total_deposit_hs total_deposit ever_partner_annual `demographic' `phone' `bank' `characteristics' q11_6_1_r_hs q11_6_5_r_hs q11_1_31_r_hs monthlysurvey tr3 tr4 tr5 {
		
		summ `i' if e(sample) == 1
		replace `i' = `i' - r(mean)
	}
	eststo: reg `var' `demographic' `phone' `bank' `characteristics' q11_6_1_r_hs q11_6_5_r_hs q11_1_31_r_hs monthlysurvey tr3 tr4 tr5 if round == 1 & treated == 1 & offermade != 0 & panel_sample == 1, robust
	restore 
}

esttab using "output\Table5.tex", replace label se star(* 0.10 ** 0.05 *** 0.01) nogaps ///
booktabs ///
substitute(\begin{tabular} \setlength{\linewidth}{.1cm}\newcommand{\contents}{\begin{tabular}  \end{tabular} \end{tabular}}\setbox0=\hbox{\contents}\setlength{\linewidth}{\wd0-2\tabcolsep-.25em}\contents {l}{\footnotesize {p{\linewidth}}{\footnotesize ) ///
noomitted ///
mgroups(span prefix(\multicolumn{@span}{c}{) suffix(})) ///
nocon drop(monthlysurvey tr3 tr4 tr5) ///
nonotes addnotes ("Account Accepted is based on enumerator reports. Demonstration completed, Used service, Amount Deposited are based on institutional data provided by the partner bank. Deposited in Partner Bank is an indicator of whether the respondent self-reported depositing savings to the partner bank in the previous month on one of the two annual surveys conducted after the roll out of the mobile-deposit service. IHS refers to amounts transformed using the inverse hyperbolic sine function.  Demonstration completed indicates that the individual is observed in the partner bank's dataset as having used the service. Regressions pool monthly and annual samples and all variables are demeaned. Regressions are conditional upon the letter being delivered and being in the Panel Sample, include treatment status and frequency of being surveyed as additional covariates, and use robust standard errors.")
eststo clear

**********Table A13
foreach var of varlist takeup demo has_one_transaction total_deposit_hs total_deposit ever_partner_annual {
	reg `var' `demographic' `phone' `bank' `characteristics' `outcomes_baseline' hh_head education seetu_member frequent_depositor has_young_adult young_40 top_up_min_distance wtp_include_missing monthlysurvey tr3 tr4 tr5 if round == 1 & treated == 1 & offermade != 0 & panel_sample == 1, robust
	
	preserve 
	foreach i of varlist takeup demo has_one_transaction total_deposit_hs total_deposit ever_partner_annual `demographic' `phone' `bank' `characteristics' `outcomes_baseline' hh_head education seetu_member frequent_depositor has_young_adult young_40 top_up_min_distance wtp_include_missing monthlysurvey tr3 tr4 tr5 {
		
		summ `i' if e(sample) == 1
		replace `i' = `i' - r(mean)
	}
	eststo: reg `var' `demographic' `phone' `bank' `characteristics' `outcomes_baseline' hh_head education seetu_member frequent_depositor has_young_adult young_40 top_up_min_distance wtp_include_missing monthlysurvey tr3 tr4 tr5 if round == 1 & treated == 1 & offermade != 0 & panel_sample == 1, robust	
	restore 	
}

esttab using "output\TableA13.tex", replace label se star(* 0.10 ** 0.05 *** 0.01) nogaps ///
booktabs ///
substitute(\begin{tabular} \setlength{\linewidth}{.1cm}\newcommand{\contents}{\begin{tabular}  \end{tabular} \end{tabular}}\setbox0=\hbox{\contents}\setlength{\linewidth}{\wd0-2\tabcolsep-.25em}\contents {l}{\footnotesize {p{\linewidth}}{\footnotesize ) ///
noomitted ///
mgroups(span prefix(\multicolumn{@span}{c}{) suffix(})) ///
nocon drop(monthlysurvey tr3 tr4 tr5) ///
nonotes addnotes ("Account Accepted is based on enumerator reports. Demonstration completed, Used service, Amount Deposited are based on institutional data provided by the partner bank. Deposited in Partner Bank is an indicator of whether the respondent self-reported depositing savings to the partner bank in the previous month on one of the two annual surveys conducted after the roll out of the mobile-deposit service. IHS refers to amounts transformed using the inverse hyperbolic sine function.  Demonstration completed indicates that the individual is observed in the partner bank's dataset as having used the service. Regressions pool monthly and annual samples and all variables are demeaned. Regressions are conditional upon the letter being delivered and being in the Panel Sample, include treatment status and frequency of being surveyed as additional covariates, and use robust standard errors.")
eststo clear

*********Table 2, Table A4, Table A5, Table A6, Table A7
*****Panel A cross section
preserve 
*ANCOVA baseline period 
foreach var of varlist `outcomes_late_hs' `outcomes_all_hs' `outcomes_late' `outcomes_all' `outcomes_late_tr' `outcomes_all_tr'{
	bysort sheno: egen `var'_x = mean(`var') if post == 0
	bysort sheno: egen `var'_baseline = max(`var'_x)
	drop `var'_x
}

keep if post == 1
*individual average: 
foreach var of varlist `outcomes_late_hs' `outcomes_all_hs' `outcomes_late' `outcomes_all' `outcomes_late_tr' `outcomes_all_tr'{
	bysort sheno: egen `var'_m = mean(`var')
}

foreach var of varlist `outcomes_late_hs' `outcomes_all_hs' `outcomes_late' `outcomes_all' `outcomes_late_tr' `outcomes_all_tr' {
	eststo est`var': reg `var'_m i.tr2 i.balancequartile i.text_read if (tr2 == 1 | tr1 == 1) & monthlysurvey == 1 & round == 11 & panel_sample == 1, robust
	summ `var'_m if tr1 == 1 & monthlysurvey == 1 & panel_sample == 1 & post == 1 & round == 11
	estadd sca cmean = r(mean)
}

*ANCOVA specification: 
foreach var of varlist `outcomes_all_hs'{
	eststo anc`var': reg `var'_m `var'_baseline i.tr2 i.balancequartile i.text_read if (tr2 == 1 | tr1 == 1) & monthlysurvey == 1 & round == 11 & panel_sample == 1, robust
	summ `var'_m if tr1 == 1 & monthlysurvey == 1 & panel_sample == 1 & post == 1 & round == 11
	estadd sca cmean = r(mean)
}


esttab `final_pre' `final_all' using "output\Table2.tex", replace label se star(* 0.10 ** 0.05 *** 0.01) nogaps ///
booktabs ///
substitute(\begin{tabular} \setlength{\linewidth}{.1cm}\newcommand{\contents}{\begin{tabular}  \end{tabular} \end{tabular}}\setbox0=\hbox{\contents}\setlength{\linewidth}{\wd0-2\tabcolsep-.25em}\contents {l}{\footnotesize {p{\linewidth}}{\footnotesize ) ///
mgroups("1[Partner" "Partner" "1[Formal" "Formal" "1[Any" "Total", pattern(1 1 1 1 1 1) span prefix(\multicolumn{@span}{c}{) suffix(})) ///
mlabels ("deposit]" "savings" "deposit]" "savings" "deposit]" "savings") ///
nocon keep(1.tr2) ///
varlabels (1.tr2 "Free Mobile Deposit Offer") ///
scalars("cmean Control Mean") ///
nonotes

esttab `final_pre_expand' `final_all_expand' using "output\TableA5.tex", replace label se star(* 0.10 ** 0.05 *** 0.01) nogaps ///
booktabs ///
substitute(\begin{tabular} \setlength{\linewidth}{.1cm}\newcommand{\contents}{\begin{tabular}  \end{tabular} \end{tabular}}\setbox0=\hbox{\contents}\setlength{\linewidth}{\wd0-2\tabcolsep-.25em}\contents {l}{\footnotesize {p{\linewidth}}{\footnotesize ) ///
mgroups(span prefix(\multicolumn{@span}{c}{) suffix(})) ///
mlabels ("Partner" "Non-Partner" "All Formal" "Cash" "Seetu" "Other" "Total") ///
nocon keep(1.tr2) ///
varlabels (1.tr2 "Free Mobile Deposit Offer") ///
scalars("cmean Control Mean") ///
nonotes

esttab `final_pre_level' `final_all_level' using "output\TableA6.tex", replace label se star(* 0.10 ** 0.05 *** 0.01) nogaps ///
booktabs ///
substitute(\begin{tabular} \setlength{\linewidth}{.1cm}\newcommand{\contents}{\begin{tabular}  \end{tabular} \end{tabular}}\setbox0=\hbox{\contents}\setlength{\linewidth}{\wd0-2\tabcolsep-.25em}\contents {l}{\footnotesize {p{\linewidth}}{\footnotesize ) ///
mgroups(span prefix(\multicolumn{@span}{c}{) suffix(})) ///
mlabels ("Partner" "Non-Partner" "All Formal" "Cash" "Seetu" "Other" "Total") ///
nocon keep(1.tr2) ///
varlabels (1.tr2 "Free Mobile Deposit Offer") ///
scalars("cmean Control Mean") ///
nonotes

esttab `final_pre_trim' `final_all_trim' using "output\TableA7.tex", replace label se star(* 0.10 ** 0.05 *** 0.01) nogaps ///
booktabs ///
substitute(\begin{tabular} \setlength{\linewidth}{.1cm}\newcommand{\contents}{\begin{tabular}  \end{tabular} \end{tabular}}\setbox0=\hbox{\contents}\setlength{\linewidth}{\wd0-2\tabcolsep-.25em}\contents {l}{\footnotesize {p{\linewidth}}{\footnotesize ) ///
mgroups(span prefix(\multicolumn{@span}{c}{) suffix(})) ///
mlabels ("Partner" "Non-Partner" "All Formal" "Cash" "Seetu" "Other" "Total") ///
nocon keep(1.tr2) ///
varlabels (1.tr2 "Free Mobile Deposit Offer") ///
scalars("cmean Control Mean") ///
nonotes

esttab `ancova' using "output\TableA4.tex", replace label se star(* 0.10 ** 0.05 *** 0.01) nogaps ///
booktabs ///
substitute(\begin{tabular} \setlength{\linewidth}{.1cm}\newcommand{\contents}{\begin{tabular}  \end{tabular} \end{tabular}}\setbox0=\hbox{\contents}\setlength{\linewidth}{\wd0-2\tabcolsep-.25em}\contents {l}{\footnotesize {p{\linewidth}}{\footnotesize ) ///
mgroups("1[Formal" "Formal" "1[Any" "Total", pattern(1 1 1 1 1 1) span prefix(\multicolumn{@span}{c}{) suffix(})) ///
mlabels ("deposit]" "savings" "deposit]" "savings") ///
nocon keep(1.tr2) ///
varlabels (1.tr2 "Free Mobile Deposit Offer") ///
scalars("cmean Control Mean") ///
nonotes addnotes ("Estimates are conducted on the monthly panel sample. Saving variables are analyzed using the Inverse Hyperbolic Sine, so the interpretation is as a log (percent impact). Outcomes are monthly flows over the month prior to the survey wave, and the unit of observation is individual. All regressions control for the stratification variables used in the randomization protocol. Regressions are a cross sectional comparison of treatment and control outcomes using all post-treatment survey waves, control for the mean savings variable in the pre-period (i.e., prior to the intervention), and use robust standard errors. Standard errors in parentheses. @starlegend.")

eststo clear
restore

*****Panel B: 
tab round, gen(rnd_con)
foreach var of varlist `outcomes_all_hs' `outcomes_all' `outcomes_all_tr'{
		eststo est`var': areg `var' i.tr2##i.post i.round i.balancequartile i.text_read if (tr2 == 1 | tr1 == 1) & monthlysurvey == 1 & panel_sample == 1 [pweight = prob_weight], absorb(sheno) cluster(sheno)
}

esttab `final_all' using "output\Table2.tex", append label se star(* 0.10 ** 0.05 *** 0.01) nogaps ///
booktabs ///
substitute(\begin{tabular} \setlength{\linewidth}{.1cm}\newcommand{\contents}{\begin{tabular}  \end{tabular} \end{tabular}}\setbox0=\hbox{\contents}\setlength{\linewidth}{\wd0-2\tabcolsep-.25em}\contents {l}{\footnotesize {p{\linewidth}}{\footnotesize ) ///
mlabels(none) collabels(none) nonumbers ///
nocon keep(1.tr2#1.post) ///
varlabels (1.tr2#1.post "Free Mobile Deposit Offer*Post") ///
addnotes ("Estimates are conducted on the monthly panel sample. Saving variables are analyzed using the Inverse Hyperbolic Sine, so the interpretation is as a log (percent impact). Outcomes are monthly flows over the month prior to the survey wave, and the unit of observation is individual in Panel A and individual-month in Panel B. All regressions control for the stratification variables used in the randomization protocol. Panel A conducts a cross sectional comparison of treatment and control outcomes using all post-treatment survey waves and uses robust standard errors. Panel B uses the full set of monthly surveys, includes individual and survey wave fixed effects, uses inverse propensity weights for the attrition across survey waves to retain representation of the overall panel sample, and clusters standard errors at the individual. The Control Mean is the mean of control individuals' means across post-treatment survey waves for the given outcome variable. Standard errors in parentheses.")

esttab `final_all_expand' using "output\TableA5.tex", append label se star(* 0.10 ** 0.05 *** 0.01) nogaps ///
booktabs ///
substitute(\begin{tabular} \setlength{\linewidth}{.1cm}\newcommand{\contents}{\begin{tabular}  \end{tabular} \end{tabular}}\setbox0=\hbox{\contents}\setlength{\linewidth}{\wd0-2\tabcolsep-.25em}\contents {l}{\footnotesize {p{\linewidth}}{\footnotesize ) ///
mlabels(none) collabels(none) nonumbers ///
nocon keep(1.tr2#1.post) ///
varlabels (1.tr2#1.post "Free Mobile Deposit Offer*Post") ///
addnotes ("Estimates are conducted on the monthly panel sample. Saving variables are analyzed using the Inverse Hyperbolic Sine, so the interpretation is as a log (percent impact). Outcomes are monthly flows over the month prior to the survey wave, and the unit of observation is individual in Panel A and individual-month in Panel B. All regressions control for the stratification variables used in the randomization protocol. Panel A conducts a cross sectional comparison of treatment and control outcomes using all post-treatment survey waves and uses robust standard errors. Panel B uses the full set of monthly surveys, includes individual and survey wave fixed effects, uses inverse propensity weights for the attrition across survey waves to retain representation of the overall panel sample, and clusters standard errors at the individual. The Control Mean is the mean of control individuals' means across post-treatment survey waves for the given outcome variable. Standard errors in parentheses.")

esttab `final_all_level' using "output\TableA6.tex", append label se star(* 0.10 ** 0.05 *** 0.01) nogaps ///
booktabs ///
substitute(\begin{tabular} \setlength{\linewidth}{.1cm}\newcommand{\contents}{\begin{tabular}  \end{tabular} \end{tabular}}\setbox0=\hbox{\contents}\setlength{\linewidth}{\wd0-2\tabcolsep-.25em}\contents {l}{\footnotesize {p{\linewidth}}{\footnotesize ) ///
mlabels(none) collabels(none) nonumbers ///
nocon keep(1.tr2#1.post) ///
varlabels (1.tr2#1.post "Free Mobile Deposit Offer*Post") ///
addnotes ("Estimates are conducted on the monthly panel sample. Saving variables are analyzed in levels of Sri Lankan (LKR) currency. Outcomes are monthly flows over the month prior to the survey wave, and the unit of observation is individual in Panel A and individual-month in Panel B. All regressions control for the stratification variables used in the randomization protocol. Panel A conducts a cross sectional comparison of treatment and control outcomes using all post-treatment survey waves and uses robust standard errors. Panel B uses the full set of monthly surveys, includes individual and survey wave fixed effects, uses inverse propensity weights for the attrition across survey waves to retain representation of the overall panel sample, and clusters standard errors at the individual. The Control Mean is the mean of control individuals' means across post-treatment survey waves for the given outcome variable. Standard errors in parentheses.")

esttab `final_all_trim' using "output\TableA7.tex", append label se star(* 0.10 ** 0.05 *** 0.01) nogaps ///
booktabs ///
substitute(\begin{tabular} \setlength{\linewidth}{.1cm}\newcommand{\contents}{\begin{tabular}  \end{tabular} \end{tabular}}\setbox0=\hbox{\contents}\setlength{\linewidth}{\wd0-2\tabcolsep-.25em}\contents {l}{\footnotesize {p{\linewidth}}{\footnotesize ) ///
mlabels(none) collabels(none) nonumbers ///
nocon keep(1.tr2#1.post) ///
varlabels (1.tr2#1.post "Free Mobile Deposit Offer*Post") ///
addnotes ("Estimates are conducted on the monthly panel sample. Saving deposits above the 99th percentile have been replaced by the 99th percentile. Saving variables are analyzed in levels of Sri Lankan (LKR) currency. Outcomes are monthly flows over the month prior to the survey wave, and the unit of observation is individual in Panel A and individual-month in Panel B. All regressions control for the stratification variables used in the randomization protocol. Panel A conducts a cross sectional comparison of treatment and control outcomes using all post-treatment survey waves and uses robust standard errors. Panel B uses the full set of monthly surveys, includes individual and survey wave fixed effects, uses inverse propensity weights for the attrition across survey waves to retain representation of the overall panel sample, and clusters standard errors at the individual. The Control Mean is the mean of control individuals' means across post-treatment survey waves for the given outcome variable. Standard errors in parentheses.")


eststo clear


**********Table 7
*****Panel A
preserve
keep if post == 1
foreach var of varlist `outcomes_late_hs' `outcomes_all_hs' `outcomes_late' `outcomes_all' `outcomes_late_tr' `outcomes_all_tr'{
	bysort sheno: egen `var'_m = mean(`var')
}
foreach var of varlist `outcomes_late_hs' `outcomes_all_hs' `outcomes_late' `outcomes_all' `outcomes_late_tr' `outcomes_all_tr'{
	eststo est`var': reg `var'_m 1.tr2##1.bank_distance_B 1.tr2##1.bank_distance_C  i.balancequartile i.text if (tr2 == 1 | tr1 == 1) & monthlysurvey == 1 & round == 11 & panel_sample == 1, robust
	test 1.tr2+1.tr2#1.bank_distance_B = 0
	estadd sca p_pf = r(p) 
	estadd sca p_beta = _b[1.tr2] + _b[1.tr2#1.bank_distance_B]
	
}

esttab `final_pre' `final_all' using "output\Table7.tex", replace label se star(* 0.10 ** 0.05 *** 0.01) nogaps ///
booktabs ///
substitute(\begin{tabular} \setlength{\linewidth}{.1cm}\newcommand{\contents}{\begin{tabular}  \end{tabular} \end{tabular}}\setbox0=\hbox{\contents}\setlength{\linewidth}{\wd0-2\tabcolsep-.25em}\contents {l}{\footnotesize {p{\linewidth}}{\footnotesize ) ///
mgroups("1[Partner" "Partner" "1[Formal" "Formal" "1[Any" "Total", pattern(1 1 1 1 1 1) span prefix(\multicolumn{@span}{c}{) suffix(})) ///
mlabels ("deposit]" "savings" "deposit]" "savings" "deposit]" "savings") ///
nocon keep(1.tr2 1.tr2#1.bank_distance_B 1.tr2#1.bank_distance_C) ///
varlabels (1.tr2 "Free (\beta_1)" 1.tr2#1.bank_distance_B "Free*Intermediate Distance (\beta_3)" 1.tr2#1.bank_distance_C "Free*Far Distance") ///
scalars("p_beta $\beta_1 + \beta_3$" "p_pf Prob > F-statistic") ///
nonotes ///

eststo clear


restore 

*****Panel B
foreach var of varlist `outcomes_all_hs' `outcomes_all' `outcomes_all_tr'{
	eststo est`var': areg `var' 1.tr2##1.bank_distance_B##i.post 1.tr2##1.bank_distance_C##i.post i.round if (tr2 == 1 | tr1 == 1) & monthlysurvey == 1 & panel_sample == 1 [pweight = prob_weight], absorb(sheno) cluster(sheno)
	test 1.tr2#1.post+1.tr2#1.post#1.bank_distance_B = 0
	estadd sca p_pf = r(p) 
	estadd sca p_beta = _b[1.tr2#1.post] + _b[1.tr2#1.post#1.bank_distance_B]
	
	
}
	


esttab `final_all' using "output\Table6.tex", append label se star(* 0.10 ** 0.05 *** 0.01) nogaps ///
booktabs ///
substitute(\begin{tabular} \setlength{\linewidth}{.1cm}\newcommand{\contents}{\begin{tabular}  \end{tabular} \end{tabular}}\setbox0=\hbox{\contents}\setlength{\linewidth}{\wd0-2\tabcolsep-.25em}\contents {l}{\footnotesize {p{\linewidth}}{\footnotesize ) ///
mlabels(none) collabels(none) nonumbers ///
nocon keep(1.tr2#1.post 1.tr2#1.bank_distance_B#1.post 1.tr2#1.bank_distance_C#1.post) ///
varlabels (1.tr2#1.post "Free*Post" 1.tr2#1.bank_distance_B#1.post "Free*Post*Intermediate" 1.tr2#1.bank_distance_C#1.post "Free*Post*Far") ///
scalars("p_beta $\beta_1 + \beta_3$" "p_pf Prob > F-statistic") ///
nonotes addnotes ("Intermediate distance refers to households 2-5 km from the nearest bank, Far Distance refers to households located greater than 5 km from the nearest bank. Estimations are conducted on the monthly panel sample. Savings variables are analyzed using the Inverse Hyperbolic Sine, so the interpretation is as a log (percent impact). Outcomes are monthly flows over the month prior to the survey wave, and the unit of observation is individual in Panel A and individual-month in Panel B. All regressions control for the stratification variables used in the randomization protocol and use robust standard errors. Panel A conducts a cross sectional comparison of treatment and control outcomes using all post-treatment survey waves and uses robust standard errors. Panel B uses the full set of monthly surveys, includes individual and survey wave fixed effects, uses inverse propensity weights for the attrition across survey waves to retain representation of the overall panel sample, and clusters standard errors at the individual.  Standard errors in parentheses. @starlegend")


eststo clear


**********Table 6, Table A14, Table A15, Table A16 (created by loop)

*****Panel A: 
foreach heter of varlist female owns_mobile hyperbolic_a education{
	preserve
	keep if post == 1
	foreach var of varlist `outcomes_late_hs' `outcomes_all_hs' `outcomes_late' `outcomes_all' `outcomes_late_tr' `outcomes_all_tr'{
		bysort sheno: egen `var'_m = mean(`var')
	}
	foreach var of varlist `outcomes_late_hs' `outcomes_all_hs' `outcomes_late' `outcomes_all' `outcomes_late_tr' `outcomes_all_tr'{
		eststo est`var': reg `var'_m 1.tr2##c.`heter' i.balancequartile i.text if (tr2 == 1 | tr1 == 1) & monthlysurvey == 1 & round == 11 & panel_sample == 1, robust
		test 1.tr2+1.tr2#`heter' = 0
		estadd sca p_pf = r(p) 
		estadd sca p_beta = _b[1.tr2] + _b[1.tr2#`heter']
		
	}

esttab `final_pre' `final_all' using "output\itt_`heter'.tex", replace label se star(* 0.10 ** 0.05 *** 0.01) nogaps ///
nocon keep(1.tr2 1.tr2#c.`heter') ///
varlabels (1.tr2 "Free (\beta_1)" 1.tr2#c.`heter' "Free*Characteristic") ///
scalars("p_beta $\beta_1 + \beta_3$" "p_pf Prob > F-statistic") ///
nonotes ///


eststo clear
restore 


*****Panel B: 
foreach var of varlist `outcomes_all_hs' `outcomes_all' `outcomes_all_tr'{
	eststo est`var': areg `var' 1.tr2##c.`heter'##i.post i.round if (tr2 == 1 | tr1 == 1) & monthlysurvey == 1 & panel_sample == 1 [pweight = prob_weight], absorb(sheno) cluster(sheno)
	test 1.tr2#1.post+1.tr2#c.`heter'#1.post = 0
	estadd sca p_pf = r(p) 
	estadd sca p_beta = _b[1.tr2#1.post] + _b[1.tr2#1.post#c.`heter']
}

esttab `final_all' using "output\itt_`heter'.tex", append label se star(* 0.10 ** 0.05 *** 0.01) nogaps ///
nocon keep(1.tr2#1.post 1.tr2#1.post#c.`heter') ///
varlabels (1.tr2#1.post "Free*Post" 1.tr2#1.post#c.`heter' "Free*Post*Characteristic") ///
scalars("p_beta $\beta_1 + \beta_3$" "p_pf Prob > F-statistic") ///
nonotes 

eststo clear

}

*****Table 3: Consumption and Labor 
foreach var of varlist `consumption_hs' `labor_supply_hs'{
	
	eststo est`var'1: areg `var' i.tr2##i.post i.round i.balancequartile i.text_read if (tr2 == 1 | tr1 == 1) & monthlysurvey == 1 & panel_sample == 1 [pweight = prob_weight], absorb(sheno) cluster(sheno)
	bysort sheno: egen `var'_m = mean(`var') if post == 1
	summ `var'_m if tr1 == 1 & monthlysurvey == 1 & panel_sample == 1 & post == 1 & round == 11
	estadd sca cmean = r(mean)
	drop `var'_m 
}

esttab using "output\Table3.tex", replace label se star(* 0.10 ** 0.05 *** 0.01) nogaps ///
nocon keep(1.tr2#1.post) ///
varlabels (1.tr2#1.post "Free*Post" ) ///
scalars("cmean Control Mean") ///
nonotes addnotes ("Estimates are conducted on the monthly panel sample. Consumption and earnings are analyzed using the Inverse Hyperbolic Sine, so the interpretation is as a log (percent impact). Outcomes are monthly flows over the month prior to the survey wave, and the unit of observation is individual-month. All regressions control for the stratification variables used in the randomization protocol, includes individual and survey wave fixed effects, uses inverse propensity weights for the attrition across survey waves to retain representation of the overall panel sample, and clusters standard errors at the individual. The Control Mean is the mean of control individuals' means across post-treatment survey waves for the given outcome variable. Clustered standard errors in parentheses.")
eststo clear

*****Appendix Table 8
foreach var of varlist `consumption_hs'{
	
	bysort sheno: egen `var'_m = mean(`var') if post == 1
	
	eststo est`var'1: areg `var' 1.tr2##1.bank_distance_B##i.post 1.tr2##1.bank_distance_C##i.post i.round if (tr2 == 1 | tr1 == 1) & monthlysurvey == 1 & panel_sample == 1 [pweight = prob_weight], absorb(sheno) cluster(sheno)
	test 1.tr2#1.post+1.tr2#1.post#1.bank_distance_B = 0
	estadd sca p_pf = r(p) 
	estadd sca p_beta = _b[1.tr2#1.post] + _b[1.tr2#1.post#1.bank_distance_B]
	summ `var'_m if tr1 == 1 & monthlysurvey == 1 & panel_sample == 1 & post == 1 & round == 11
	estadd sca cmean = r(mean)
	
	eststo est`var'2: areg `var' 1.tr2##1.female##i.post i.round if (tr2 == 1 | tr1 == 1) & monthlysurvey == 1 & panel_sample == 1 [pweight = prob_weight], absorb(sheno) cluster(sheno)
	test 1.tr2#1.post+1.tr2#1.post#1.female = 0
	estadd sca p_pf = r(p) 
	estadd sca p_beta = _b[1.tr2#1.post] + _b[1.tr2#1.post#1.female]
	summ `var'_m if tr1 == 1 & monthlysurvey == 1 & panel_sample == 1 & post == 1 & round == 11
	estadd sca cmean = r(mean)
	
	eststo est`var'3: areg `var' 1.tr2##1.hyperbolic_a##i.post i.round if (tr2 == 1 | tr1 == 1) & monthlysurvey == 1 & panel_sample == 1 [pweight = prob_weight], absorb(sheno) cluster(sheno)
	test 1.tr2#1.post+1.tr2#1.post#1.hyperbolic_a = 0
	estadd sca p_pf = r(p) 
	estadd sca p_beta = _b[1.tr2#1.post] + _b[1.tr2#1.post#1.hyperbolic_a]
	summ `var'_m if tr1 == 1 & monthlysurvey == 1 & panel_sample == 1 & post == 1 & round == 11
	estadd sca cmean = r(mean)
	
	drop `var'_m 
	
}

esttab using "output\TableA8.tex", replace label se star(* 0.10 ** 0.05 *** 0.01) nogaps ///
nocon keep(1.tr2#1.post 1.tr2#1.female#1.post 1.tr2#1.bank_distance_B#1.post 1.tr2#1.bank_distance_C#1.post 1.tr2#1.hyperbolic_a#1.post) ///
varlabels (1.tr2#1.post "Free*Post" 1.tr2#1.female#1.post "Free*Female*Post" 1.tr2#1.hyperbolic_a#1.post "Free*Present-Biased*Post"  1.tr2#1.bank_distance_B#1.post "Free*Intermediate*Post" 1.tr2#1.bank_distance_C#1.post "Free*Far*Post") ///
scalars("cmean Control Mean" "p_beta $\beta_1 + \beta_3$" "p_pf Prob > F-statistic") ///
nonotes addnotes ("Estimates are conducted on the monthly panel sample. Consumption is analyzed using the Inverse Hyperbolic Sine, so the interpretation is as a log (percent impact). Outcomes are monthly flows over the month prior to the survey wave, and the unit of observation is individual-month. All regressions control for the stratification variables used in the randomization protocol, includes individual and survey wave fixed effects, uses inverse propensity weights for the attrition across survey waves to retain representation of the overall panel sample, and clusters standard errors at the individual. The Control Mean is the mean of control individuals' means across post-treatment survey waves for the given outcome variable. Clustered standard errors in parentheses.")
eststo clear



*****Appendix Table 9: 
foreach var of varlist `labor_supply_hs'{
	
	bysort sheno: egen `var'_m = mean(`var') if post == 1
	
	eststo est`var'2: areg `var' 1.tr2##1.bank_distance_B##i.post 1.tr2##1.bank_distance_C##i.post i.round if (tr2 == 1 | tr1 == 1) & monthlysurvey == 1 & panel_sample == 1 [pweight = prob_weight], absorb(sheno) cluster(sheno)
	test 1.tr2#1.post+1.tr2#1.post#1.bank_distance_B = 0
	estadd sca p_pf = r(p) 
	estadd sca p_beta = _b[1.tr2#1.post] + _b[1.tr2#1.post#1.bank_distance_B]
	summ `var'_m if tr1 == 1 & monthlysurvey == 1 & panel_sample == 1 & post == 1 & round == 11
	estadd sca cmean = r(mean)
	
	eststo est`var'3: areg `var' 1.tr2##1.female##i.post i.round if (tr2 == 1 | tr1 == 1) & monthlysurvey == 1 & panel_sample == 1 [pweight = prob_weight], absorb(sheno) cluster(sheno)
	test 1.tr2#1.post+1.tr2#1.post#1.female = 0
	estadd sca p_pf = r(p) 
	estadd sca p_beta = _b[1.tr2#1.post] + _b[1.tr2#1.post#1.female]
	summ `var'_m if tr1 == 1 & monthlysurvey == 1 & panel_sample == 1 & post == 1 & round == 11
	estadd sca cmean = r(mean)
	
	eststo est`var'4: areg `var' 1.tr2##1.hyperbolic_a##i.post i.round if (tr2 == 1 | tr1 == 1) & monthlysurvey == 1 & panel_sample == 1 [pweight = prob_weight], absorb(sheno) cluster(sheno)
	test 1.tr2#1.post+1.tr2#1.post#1.hyperbolic_a = 0
	estadd sca p_pf = r(p) 
	estadd sca p_beta = _b[1.tr2#1.post] + _b[1.tr2#1.post#1.hyperbolic_a]
	summ `var'_m if tr1 == 1 & monthlysurvey == 1 & panel_sample == 1 & post == 1 & round == 11
	estadd sca cmean = r(mean)
	
	drop `var'_m
}

esttab using "output\TableA9.tex", replace label se star(* 0.10 ** 0.05 *** 0.01) nogaps ///
nocon keep(1.tr2#1.post 1.tr2#1.female#1.post 1.tr2#1.bank_distance_B#1.post 1.tr2#1.bank_distance_C#1.post 1.tr2#1.hyperbolic_a#1.post) ///
varlabels (1.tr2#1.post "Free*Post" 1.tr2#1.female#1.post "Free*Female*Post" 1.tr2#1.hyperbolic_a#1.post "Free*Present-Biased*Post"  1.tr2#1.bank_distance_B#1.post "Free*Intermediate*Post" 1.tr2#1.bank_distance_C#1.post "Free*Far*Post") ///
scalars("cmean Control Mean" "p_beta $\beta_1 + \beta_3$" "p_pf Prob > F-statistic") ///
nonotes addnotes ("Estimates are conducted on the monthly panel sample. Earrnings is analyzed using the Inverse Hyperbolic Sine, so the interpretation is as a log (percent impact). Outcomes are monthly flows over the month prior to the survey wave, and the unit of observation is individual-month. All regressions control for the stratification variables used in the randomization protocol, includes individual and survey wave fixed effects, uses inverse propensity weights for the attrition across survey waves to retain representation of the overall panel sample, and clusters standard errors at the individual. The Control Mean is the mean of control individuals' means across post-treatment survey waves for the given outcome variable. Clustered standard errors in parentheses.")
eststo clear


**********Table 4, Table A10, Table A11, Table A12
***price elasticity
gen fee = 0 if tr2 == 1
replace fee = 2 if tr3 == 1
replace fee = 4 if tr4 == 1
replace fee = 8 if tr5 == 1

gen fee_hs = ln(fee+(fee^2+1)^(1/2))

*weight for Table A11 
gen respond = 1 - attrition
qui reg respond 1.tr3##c.phone_savvy 1.tr4##c.phone_savvy 1.tr5##c.phone_savvy 1.tr3##c.bank_experience 1.tr4##c.bank_experience 1.tr5##c.bank_experience 1.tr3##c.month_discount_rate 1.tr4##c.month_discount_rate 1.tr5##c.month_discount_rate 1.tr3##c.willing_risk 1.tr4##c.willing_risk 1.tr5##c.willing_risk 1.tr3##i.hyperbolic_a 1.tr4##1.hyperbolic_a 1.tr5##1.hyperbolic_a 1.tr3##i.bank_distance_B 1.tr4##1.bank_distance_B 1.tr5##1.bank_distance_B 1.tr3##i.owns_mobile 1.tr4##1.owns_mobile 1.tr5##1.owns_mobile 1.tr3##i.female 1.tr4##1.female 1.tr5##1.female 1.tr3##i.married 1.tr4##1.married 1.tr5##1.married i.balancequartile i.text_read if monthlysurvey == 0
predict est_respond
gen response_weight = 1/est_respond
drop respond est_respond

preserve
keep if post == 1

foreach var of varlist deposit deposit_hs deposit_ratio `outcomes_late_hs_price' `outcomes_all_hs_price' `outcomes_late_price' `outcomes_all_price'{
	bysort sheno: egen `var'_m = mean(`var')
}

***Table 4, Panel A
*gen fee_charged = (tr2 == 0)
foreach var of varlist deposit_hs deposit_ratio `outcomes_late_hs_price' `outcomes_all_hs_price'{
		eststo: reg `var'_m fee_hs i.balancequartile i.text_read if annual_round == 1 & round == 22 & monthlysurvey == 0 & panel_sample == 1, robust	
}
esttab using "output\Treatment_Effects_Fees.csv", keep (fee_hs) p star(* 0.1 ** 0.05 *** 0.01) parentheses replace
eststo clear

***Table A10, Panel A
foreach var of varlist deposit_hs deposit_ratio `outcomes_late_hs_price' `outcomes_all_hs_price'{
		eststo: reg `var'_m fee i.balancequartile i.text_read if annual_round == 1 & round == 22 & monthlysurvey == 0 & panel_sample == 1, robust

}
esttab using "output\Treatment_Effects_Fees.csv", keep (fee) p star(* 0.1 ** 0.05 *** 0.01) parentheses append
eststo clear 

***Table A11, Panel A
foreach var of varlist deposit_hs deposit_ratio `outcomes_late_hs_price' `outcomes_all_hs_price'{
		eststo:  reg `var'_m fee_hs i.balancequartile i.text_read if annual_round == 1 & round == 22 & monthlysurvey == 0 & panel_sample == 1 [pweight = response_weight], robust
}
esttab using "output\Treatment_Effects_Fees.csv", keep (fee_hs) p star(* 0.1 ** 0.05 *** 0.01) parentheses append
eststo clear


***Table A12, Panel A
foreach var of varlist deposit `outcomes_late_price' `outcomes_all_price'{
		eststo est`var': reg `var'_m fee i.balancequartile i.text_read if annual_round == 1 & round == 22 & monthlysurvey == 0 & panel_sample == 1, robust
}
esttab using "output\Treatment_Effects_Fees.csv", p star(* 0.1 ** 0.05 *** 0.01) parentheses append
eststo clear

***Reported Free Mean: 
foreach var of varlist deposit deposit_hs deposit_ratio `outcomes_late_hs_price' `outcomes_all_hs_price' `outcomes_late_price' `outcomes_all_price'{
		summ `var'_m if annual_round == 1 & round == 22 & monthlysurvey == 0 & panel_sample == 1 & tr2 == 1
}
restore

gen fee_post = fee*post
gen fee_post_hs = fee_hs*post

***Table 4, Panel B
foreach var of varlist `outcomes_all_hs_price'{
	eststo: areg `var' fee_post_hs i.round i.balancequartile i.text if annual_round == 1 & monthlysurvey == 0 & panel_sample == 1 [pweight = prob_weight], absorb(sheno) cluster(sheno)
}
esttab using "output\Treatment_Effects_Fees.csv", p star(* 0.1 ** 0.05 *** 0.01) parentheses append
eststo clear

***Table A10, Panel B
foreach var of varlist `outcomes_all_hs_price'{
	eststo : areg `var' fee_post i.round i.balancequartile i.text if annual_round == 1 & monthlysurvey == 0 & panel_sample == 1 [pweight = prob_weight], absorb(sheno) cluster(sheno)

}
esttab using "output\Treatment_Effects_Fees.csv", p star(* 0.1 ** 0.05 *** 0.01) parentheses append
eststo clear

***Table A11, Panel B
foreach var of varlist `outcomes_all_hs_price'{
	eststo: areg `var' 0.tr2 fee_post_hs i.round i.balancequartile i.text if annual_round == 1 & monthlysurvey == 0 & panel_sample == 1 [pweight = response_weight], absorb(sheno) cluster(sheno)
}
esttab using "output\Treatment_Effects_Fees.csv", p star(* 0.1 ** 0.05 *** 0.01) parentheses append
eststo clear


***Table A12, Panel B: 
foreach var of varlist  `outcomes_all_price '{
	eststo est`var': areg `var' fee_post i.round i.balancequartile i.text if annual_round == 1 & monthlysurvey == 0 & panel_sample == 1 [pweight = prob_weight], absorb(sheno) cluster(sheno)
}
esttab using "output\Treatment_Effects_Fees.csv", p star(* 0.1 ** 0.05 *** 0.01) parentheses append
eststo clear

**********Table A.1
 
eststo at1: reg panel_sample 1.tr2 i.balancequartile i.text_read if (tr2 == 1 | tr1 == 1) & monthlysurvey == 1 & round == 1, robust
eststo at2: reg panel_sample 1.tr2 i.balancequartile i.text_read if (tr2 == 1 | tr1 == 1) & monthlysurvey == 1 & round == 1 & female == 1, robust
eststo at3: reg panel_sample 1.tr2 i.balancequartile i.text_read if (tr2 == 1 | tr1 == 1) & monthlysurvey == 1 & round == 1 & bank_distance_B == 1, robust
eststo at4: reg panel_sample 1.tr2 i.balancequartile i.text_read if (tr2 == 1 | tr1 == 1) & monthlysurvey == 1 & round == 1 & hyperbolic_a == 1, robust
eststo at5: reg panel_sample 1.tr3 1.tr4 1.tr5 i.balancequartile i.text_read if monthlysurvey == 0 & round == 1, robust

gen responded = 1 - attrition 
replace responded = . if monthlysurvey == 0 & annual_round == 0

eststo at6: reg responded 1.tr2##1.post i.balancequartile i.text_read if (tr2 == 1 | tr1 == 1) & monthlysurvey == 1, vce(cluster sheno)
eststo at7: reg responded 1.tr2##1.post i.balancequartile i.text_read if (tr2 == 1 | tr1 == 1) & monthlysurvey == 1  & female == 1, vce(cluster sheno)
eststo at8: reg responded 1.tr2##1.post i.balancequartile i.text_read if (tr2 == 1 | tr1 == 1) & monthlysurvey == 1  & bank_distance_B == 1, vce(cluster sheno)
eststo at9: reg responded 1.tr2##1.post i.balancequartile i.text_read if (tr2 == 1 | tr1 == 1) & monthlysurvey == 1  & hyperbolic_a == 1, vce(cluster sheno)
eststo at10: reg responded 1.tr3##1.post 1.tr4##1.post 1.tr5##1.post i.balancequartile i.text_read if monthlysurvey == 0, vce(cluster sheno)

esttab at1 at6 at2 at7 at3 at8 at4 at9 using "output\TableA1.tex", drop(*.balancequartile *.text_read 1.post _cons) replace label se star(* 0.10 ** 0.05 *** 0.01) nogaps ///
	booktabs ///
	substitute(\begin{tabular} \setlength{\linewidth}{.1cm}\newcommand{\contents}{\begin{tabular}  \end{tabular} \end{tabular}}\setbox0=\hbox{\contents}\setlength{\linewidth}{\wd0-2\tabcolsep-.25em}\contents {l}{\footnotesize {p{\linewidth}}{\footnotesize ) ///
	mgroups("Panel" "Surveyed", pattern(1 0 1 0 1 0 1 0) lhs(\textit{Dependent Variable:})  end( \hline)) ///
	varlabels(1.tr2 "Free Mobile Deposit Offer" 1.tr2#1.post "Free Mobile Deposit Offer*Post") ///
	addnotes ("Panel is an indicator for whether the individual is observed in the panel sample, defined as having at least one survey response in the period after the mobile deposit offer if rolled out (i.e., after the delivery of initial letters). Responded is an indicator for whether the individual responded to the survey in the given month (or year for the annual sample) of the survey and is not conditional upon being observed in the Panel Sample. Panel A is restricted to the monthly surveyed sample and Panel B is restricted to the annually surveyed sample. Post is an indicator variable for survey rounds after the initial offer letters for the service were delivered (i.e., December 2011 and onward). Mid-range distance refers to whether the individual lived two to five km from the closest bank. Regressions include variables upon which the random assignment were stratified. Robust standard errors are used in regressions with Panel as the dependent variable, and standard errors are clustered at the individual level in regressions with Responded as the dependent variable. Control and Free Offer Mean report the mean of the sub-group in the post period.")
	
esttab at5 at10 using "output\TableA1.tex", drop(*.balancequartile *.text_read 1.post _cons) append label se star(* 0.10 ** 0.05 *** 0.01) nogaps ///
	booktabs ///
	substitute(\begin{tabular} \setlength{\linewidth}{.1cm}\newcommand{\contents}{\begin{tabular}  \end{tabular} \end{tabular}}\setbox0=\hbox{\contents}\setlength{\linewidth}{\wd0-2\tabcolsep-.25em}\contents {l}{\footnotesize {p{\linewidth}}{\footnotesize ) ///
	mgroups("Panel" "Surveyed", pattern(1 0 1 0 1 0 1 0) lhs(\textit{Dependent Variable:})  end( \hline)) ///
	varlabels(1.tr3 "2\% Mobile Deposit Offer" 1.tr3#1.post "2\% Mobile Deposit Offer*Post" 1.tr4 "4\% Mobile Deposit Offer" 1.tr4#1.post "4\% Mobile Deposit Offer*Post" 1.tr5 "8\% Mobile Deposit Offer" 1.tr5#1.post "8\% Mobile Deposit Offer*Post") ///
	addnotes ("Panel is an indicator for whether the individual is observed in the panel sample, defined as having at least one survey response in the period after the mobile deposit offer if rolled out (i.e., after the delivery of initial letters). Responded is an indicator for whether the individual responded to the survey in the given month (or year for the annual sample) of the survey and is not conditional upon being observed in the Panel Sample. Panel A is restricted to the monthly surveyed sample and Panel B is restricted to the annually surveyed sample. Post is an indicator variable for survey rounds after the initial offer letters for the service were delivered (i.e., December 2011 and onward). Mid-range distance refers to whether the individual lived two to five km from the closest bank. Regressions include variables upon which the random assignment were stratified. Robust standard errors are used in regressions with Panel as the dependent variable, and standard errors are clustered at the individual level in regressions with Responded as the dependent variable. Control and Free Offer Mean report the mean of the sub-group in the post period.")
	
eststo clear

***reported control/free mean
summ responded panel_sample if tr1 == 1 & monthlysurvey == 1 & post == 1
summ responded panel_sample if tr1 == 1 & monthlysurvey == 1 & post == 1 & female == 1
summ responded panel_sample if tr1 == 1 & monthlysurvey == 1 & post == 1 & bank_distance_B == 1
summ responded panel_sample if tr1 == 1 & monthlysurvey == 1 & post == 1 & hyperbolic_a == 1

summ responded panel_sample if tr2 == 1 & monthlysurvey == 0 & post == 1




 

